{include file="public/header" /}
<body>
       

<div class="layui-fluid">
    <div class="layui-card" >
		<div class="layui-card-header">修改工具借还</div>
      

        <form class="layui-form" action="" id="form1" lay-filter="form1">
            
            
<div class="layui-form-item" >
    <label class="layui-form-label">工具RFID号</label>
	<div class="layui-input-block" >
		<input type="text"  class="layui-input" id="code" name="code" value="{$info['code']}" >﻿<input type="hidden" id="id" name="id" value="{$info['id']}">
	</div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>


<div class="layui-form-item" >
    <label class="layui-form-label">工具名称</label>
	<div class="layui-input-block" >
		<input type="text" lay-verify="required" class="layui-input" id="name" name="name" value="{$info['name']}" >
	</div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>


<div class="layui-form-item" >
    <label class="layui-form-label">工具类型</label>
	<div class="layui-input-block" >
		<input type="text" lay-verify="required" class="layui-input" id="type" name="type" value="{$info['type']}" >
	</div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>


<div class="layui-form-item" >
    <label class="layui-form-label">借用数量</label>
	<div class="layui-input-block" >
		<input type="text" lay-verify="required" class="layui-input" id="number" name="number" value="{$info['number']}" >
	</div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>


<div class="layui-form-item" >
    <label class="layui-form-label">借用时间</label>
	<div class="layui-input-block" >
		
	<input type="text" class="layui-input" lay-verify="required" id=borrowingtime name=borrowingtime placeholder="" value="{$info['borrowingtime']}">
    <SCRIPT>
        layui.use(['laydate', 'jquery'], function(){
			var $ = layui.$
				,laydate = layui.laydate;
			laydate.render({
				elem: '#borrowingtime'
				,type: 'datetime'
			  });
		});
    </SCRIPT>


	</div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>


<div class="layui-form-item" >
    <label class="layui-form-label">借用人</label>
	<div class="layui-input-block" >
		<input type="text" lay-verify="required" class="layui-input" id="borrower" name="borrower" value="{$info['borrower']}" >
	</div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>



            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="savedata">保存修改</button>
                </div>
            </div>
        </form>
       <script>
           {php} if(session('roleid')>5){ {/php}
            $("input[name='ispublic']").parent().parent().hide();
           {php}}{/php}
        </script>
    </div>

</div>



<script>
     
     
    $("#code").change(function(){
          //$(this).css("background-color","#FFFFCC");
          
         var myurl="{:url('getinfofromother_code')}?rfid="+$(this).val();
         $.ajax({
            type: "get",        // 请求方式
            url: myurl, // 请求路径
            dataType: "json",   // 预期返回一个 json 类型数据
            success: function (data) {   // data是形参名，代表返回的数据
                 
             $("#name").val('');
               
             $("#type").val('');
             
      
              
             $("#name").val(data.name);
               
             $("#type").val(data.type);
             
                
            }
        });

          

          
          
     });
      
   
    
    
</script>



      {include file="public/footer" /}
      <script>
			var uploadimgurl = "{:url('/comm/upload/uploadimg')}";
      </script>
      <script src="__SKIN__/js/jmzhfsconfiguploadform.js?v=1.222"></script>
  
      <script type="text/javascript">


            $(function () {
                  formsubmit('form1',"{$editurl}");
            });

      </script>

<style>

    /* 每列表单过多，防止窜行，缩小宽度 */
    .layui-form-label{
       padding: 9px 10px;
    }
    
</style> 
</body>


</html>